define(function (require, exports, module) {
    const ajax = require("/common/ajax");
    const getHost = require("/common/hostConfig")
    // 根据ak获取用户信息
    const getUserInfoByAk = (params, env, loading) => {

        let opt = {
            url: `v1/broker/getBrokerDetail`,
            baseURL: getHost(env).broker_center_host,
            params,
            loading,
        };
        if(params.ak) {
            opt.headers = {
                "Authorization":params.ak,
            }
            delete opt.params.ak;
        }

        return ajax.getJSON(opt);
    };


// 密码登录(何坤霖)
const login4password = (data,env) => {
    const opt = {
      baseURL:getHost(env).oauth_host,
      url:"Authorization/Login",
      data,
    }
    return ajax.postJSON(opt);
  }

    module.exports = {
        getUserInfoByAk,
        login4password,
    }

})


